
package com.jf.cloud.order.feign;

import com.jf.cloud.api.order.bo.EsPurchaseOrderBO;
import com.jf.cloud.api.order.feign.PurchaseOrderFeignClient;
import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.order.service.PurchaseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Hidden;

import java.util.List;

/**
 * @author zz
 * @date 2020/12/25
 */
@RestController
@Hidden
public class PurchaseOrderFeignController implements PurchaseOrderFeignClient {

    @Autowired
    private PurchaseOrderService purchaseOrderService;

    @Override
    public ServerResponseEntity<EsPurchaseOrderBO> saveMongoAndGetEsInfo(Long purchaseOrderId) {
        EsPurchaseOrderBO esOrderBO = purchaseOrderService.saveMongoAndGetEsInfo(purchaseOrderId);
        return ServerResponseEntity.success(esOrderBO);
    }


    @Override
    public ServerResponseEntity<Void> updatePurchaseOrderStatus(List<Long> purchaseOrderIds, Integer purchaseOrderStatus) {
        purchaseOrderService.updatePurchaseOrderStatus(purchaseOrderIds, purchaseOrderStatus);
        return ServerResponseEntity.success();
    }
}
